load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "hydrateddesccache",
    srcs = ["hydratedcache.go"],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/catalog/hydrateddesccache",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/lease",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/sem/tree",
        "//pkg/util/cache",
        "//pkg/util/metric",
        "//pkg/util/syncutil",
        "//pkg/util/syncutil/singleflight",
        "@com_github_biogo_store//llrb",
        "@com_github_prometheus_client_model//go",
    ],
)

go_test(
    name = "hydrateddesccache_test",
    srcs = ["hydratedcache_test.go"],
    embed = [":hydrateddesccache"],
    deps = [
        "//pkg/security/username",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/dbdesc",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/funcdesc",
        "//pkg/sql/catalog/nstree",
        "//pkg/sql/catalog/schemadesc",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/catalog/typedesc",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/util/leaktest",
        "@com_github_stretchr_testify//require",
    ],
)
